<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:91:"/app/wwwroot/zhangwei/www/gongzi/public/../application/index/view/manage/payslip_check.html";i:1671875146;s:74:"/app/wwwroot/zhangwei/www/gongzi/application/index/view/layout/manage.html";i:1671875144;s:74:"/app/wwwroot/zhangwei/www/gongzi/application/index/view/common/script.html";i:1671875145;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head class="layui-layout-body">
    <meta charset="utf-8">
    <title><?php echo htmlentities($site['name']); ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit">
    <link href="/assets/css/frontend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo htmlentities(\think\Config::get('site.version')); ?>" rel="stylesheet">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="/assets/js/html5shiv.js"></script>
    <script src="/assets/js/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
        var require = {
            config: <?php echo json_encode($config); ?>
        };
    </script>
</head>
<body class="layui-layout-body" id="layer1">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-nav layui-layout-right">
            <div class="head_img"><img src="<?php echo cdnurl(htmlentities($user['avatar'])); ?>" alt=""/><?php echo $user['nickname']; ?></div>
        </div>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧垂直导航区域-->
            <div class="logo"><img src="/assets/manage/images/logo.png" width="64" height="64" alt=""/></div>
            <ul class="layui-nav nav">
                <?php if($auth->check('manage/index')): ?>
                <li class="layui-nav-item <?php echo check_navs_active('manage/index'); ?>">
                    <a href="<?php echo url('manage/index'); ?>"><i class="iconfont icon-shouye"></i>首页</a>
                </li>
                <?php endif; if($auth->check('manage/payslip_add')): ?>
                <li class="layui-nav-item <?php echo check_navs_active('manage/payslip_add'); ?>">
                    <a href="<?php echo url('manage/payslip_add'); ?>"><i class="iconfont icon-gongzitiao"></i>新增工资条</a>
                </li>
                <?php endif; if($auth->check('manage/index')): ?>
                <li class="layui-nav-item <?php echo check_navs_active('manage/payslip_list'); ?>">
                    <a href="<?php echo url('manage/payslip_list'); ?>"><i class="iconfont icon-fasongxiaoxi"></i>发送记录</a>
                </li>
                <?php endif; if($auth->check('manage/payslip_feedback')): ?>
                <li class="layui-nav-item <?php echo check_navs_active('manage/payslip_feedback'); ?>">
                    <a href="<?php echo url('manage/payslip_feedback'); ?>"><i class="iconfont icon-xinxi"></i>反馈查看</a>
                </li>
                <?php endif; if($auth->check('manage/payslip_settings')): ?>
                <li class="layui-nav-item <?php echo check_navs_active('manage/payslip_settings'); ?>">
                    <a href="<?php echo url('manage/payslip_settings'); ?>"><i class="iconfont icon-shezhi2"></i>发放设置</a>
                </li>
                <?php endif; if($auth->check('manage/address_book')): ?>
                <li class="layui-nav-item <?php echo check_navs_active('manage/address_book'); ?>">
                    <a href="<?php echo url('manage/address_book'); ?>"><i class="iconfont icon-bg-maillist"></i>通讯录</a>
                </li>
                <?php endif; ?>
            </ul>
        </div>
    </div>
    <div class="layui-body">
        <div class="content gzt_main">
    <div class="layui-card gzt_header layui-row">
        <div class="item layui-col-md6 selected">
            <i class="icon"></i>
            <span>上传工资表</span>
            <div class="line"></div>
        </div>
        <div class="item layui-col-md6 active">
            <i class="icon"></i>
            <span>核对工资表</span>
            <div class="line"></div>
        </div>
        <div class="item2">
            <i class="icon"></i>
            <span>发放工资表</span>
        </div>
    </div>
    <div class="layui-tab gzt_main2">
        <ul class="layui-tab-title">
            <li<?php echo $status == 1 ? ' class="layui-this"' : ''; ?>><a href="<?php echo url('manage/payslip_check', ['id' => $id, 'status' => 1]); ?>">发放记录</a></li>
            <li<?php echo $status == 2 ? ' class="layui-this"' : ''; ?>><a href="<?php echo url('manage/payslip_check', ['id' => $id, 'status' => 2]); ?>">失败记录</a></li>
        </ul>
        <div class="layui-tab-content layui-card">
            <div class="search_box">
                <form id="search-form" class="layui-form layui-clear" role="form" data-toggle="validator" method="GET" action="<?php echo url('manage/payslip_check', ['id' => $id]); ?>">
                    <div class="search_input">
                        <input type="text" name="keywords" value="<?php echo htmlentities($keywords); ?>" placeholder="请输入员工姓名、手机号搜索" class="layui-input">
                        <button type="submit" class="search_icon iconfont icon-sousuo"></button>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">选择部门</label>
                        <div class="layui-input-inline">
                            <select name="department_id" lay-filter="department_id">
                                <option value="">请选择部门</option>
                                <?php if($departments): foreach($departments as $did => $dname): ?>
                                <option value="<?php echo $did; ?>" <?php if($did==$department_id): ?>selected<?php endif; ?>><?php echo $dname; ?></option>
                                <?php endforeach; endif; ?>
                            </select>
                        </div>
                    </div>
                    <input type="hidden" name="page" value="<?php echo $lists['current_page']; ?>">
                    <div class="but">
                        <a class="del_but del_all">删除</a>
                    </div>
                </form>
            </div>
            <div class="layui-tab-item layui-show">
                <div class="table">
                    <table class="layui-table" lay-skin="line" lay-even="">
                        <thead>
                        <tr>
                            <th><div class="checkbox"><i class="iconfont icon-gou"></i></div></th>
                            <th>姓名</th>
                            <th>部门</th>
                            <th>账号</th>
                            <th>实发工资</th>
                            <?php if($columns): foreach($columns as $name): ?>
                            <th><?php echo $name; ?></th>
                            <?php endforeach; endif; ?>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if($lists['data']): foreach($lists['data'] as $item): ?>
                        <tr>
                            <td><div class="checkbox" data-id="<?php echo $item['id']; ?>"><i class="iconfont icon-gou"></i></div></td>
                            <td><div class="w_80"><?php echo (isset($item['nickname']) && ($item['nickname'] !== '')?$item['nickname']:'<span class="yg_no">无此员工</span>'); ?></div></td>
                            <td><div class="w_100"><?php echo (isset($item['department_name']) && ($item['department_name'] !== '')?$item['department_name']:'-'); ?></div></td>
                            <td><div class="w_100"><?php echo (isset($item['username']) && ($item['username'] !== '')?$item['username']:'-'); ?></div></td>
                            <td><div class="text_box"><input type="text" data-id="<?php echo $item['id']; ?>" data-name="payslip_total" class="layui-input field" value="<?php echo $item['payslip_total']; ?>"></div></td>
                            <?php if($columns): foreach($columns as $name): ?>
                            <td><div class="text_box"><input type="text" data-id="<?php echo $item['id']; ?>" data-name="payslip_json[<?php echo $name; ?>]" class="layui-input field" value="<?php echo $item[$name]; ?>"></div></td>
                            <?php endforeach; endif; ?>
                            <td class="but_box">
                                <?php if($item['user_id']): ?>
                                <a class="cancel_but" data-id="<?php echo $item['id']; ?>">取消匹配</a>
                                <?php else: ?>
                                <a class="pipei_but" data-id="<?php echo $item['id']; ?>" data-amount="<?php echo $item['payslip_total']; ?>">手动匹配</a>
                                <?php endif; ?> ｜
                                <a class="del_but" data-id="<?php echo $item['id']; ?>">删除</a>
                            </td>
                        </tr>
                        <?php endforeach; endif; ?>
                        </tbody>
                    </table>
                </div>
                <div id="laypage" data-total="<?php echo $lists['total']; ?>" data-per_page="<?php echo $lists['per_page']; ?>" data-current_page="<?php echo $lists['current_page']; ?>"></div>
            </div>
        </div>
    </div>
    <div class="add_but_box">
        <a href="javascript:;" class="layui-btn layui-btn-primary back_but" data-url="<?php echo url('manage/payslip_add'); ?>">上一步</a>
        <a href="<?php echo url('manage/payslip_confirm', ['id' => $id]); ?>" class="layui-btn layui-btn-determine">下一步</a>
    </div>
</div>

<div class="pop pipei_pop">
    <div class="pop_content">
        <form id="bind-form" class="layui-form layui-clear" role="form" data-toggle="validator" method="POST" action="<?php echo url('manage/payslip_check'); ?>">
            <div class="layui-card-header">手动匹配</div>
            <div class="close iconfont icon-guanbi"></div>
            <div class="layui-card-body">
                <div class="pipei_item">实发工资：<span class="amount"></span><span class="yg_no">无此员工</span></div>
                <div class="fxlx_item layui-clear">
                    <input type="text" name="nickname" placeholder="请输入匹配员工姓名…" class="layui-input">
                    <a class="layui-btn search_but">搜索</a>
                </div>
                <div class="pipei_list"></div>
            </div>
            <div class="pop_but">
                <input type="hidden" name="id" value="">
                <input type="hidden" name="type" value="user_bind">
                <a class="layui-btn layui-btn-primary">取消</a>
                <button type="submit" class="layui-btn layui-btn-determine">确定</button>
            </div>
        </form>
    </div>
</div>

<script type="text/html" id="user_tpl">
    <% for(i = 0; i < data.length; i ++) { %>
    <% if (i == 0) { %><input type="hidden" name="user_id" value="<%=data[i]['id']%>"><% } %>
    <div class="pipei_item2<% if (i == 0) { %> active<% } %>" data-id="<%=data[i]['id']%>">
        <div class="head_img"><img src="<%=data[i]['avatar']%>" alt=""/></div>
        <h3><%=data[i]['nickname']%></h3>
        <p><%=data[i]['department_name']%></p>
    </div>
    <% } %>
</script>
    </div>
</div>
<link rel="stylesheet" href="/assets/manage/layui/css/layui.css">
<link rel="stylesheet" href="/assets/manage/css/css.css?v=<?php echo htmlentities(\think\Config::get('site.version')); ?>">
<link rel="stylesheet" href="//at.alicdn.com/t/c/font_3789954_npmbld8fjlc.css">
<script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-frontend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
</body>
</html>